<style lang="less">
  .person-info-text-center {
    text-align: center;
    font-size: 14px;
  }

  .pi-modal-form {
    font-size: 14px;
    line-height: 45px;
    width: 812px;
    /*height: 430px;*/
    margin: 0 auto;
  }

  .pi-form-border {
    border-top: 1px solid #000;
    border-left: 1px solid #000;
  }

  .pi-form-right {
    border-right: 1px solid #000;
  }

  .pi-form-bottom {
    border-bottom: 1px solid #000;
  }

  .pi-form-title {
    background-color: #f7f7f7;
    text-align: center;
    color: #4b8ce6;
    height: 45px;
  }

  .pi-form-content {
    height: 45px;
    padding-left: 8px;
  }

  .pi-photo {
    width: 100%;
    height: 179px;
    float: left;
  }

  .pi-form-input {
    border: none;
    color: #777;
    width: 95%;
    height: 90%;
  }

  .pi-w90 {
    width: 11%;
    float: left;
  }

  .pi-w120 {
    width: 15%;
    float: left;
  }

  .pi-w140 {
    width: 17%;
    float: left;
  }

  .pi-w160 {
    width: 20%;
    float: left;
  }

  .pi-w180 {
    width: 23%;
    float: left;
  }
  .pi-w100 {
    width: 100px;
    float: left;
  }
  .pi-w390 {
    width: 41%;
    float: left;
  }
  .pi-w490 {
    width: 49%;
    float: left;
  }
  .pi-w580 {
    width: 72%;
    float: left;
  }

  .pi-w670 {
    width: 83%;
    float: left;
  }
  .pi-w210 {
    width: 210px;
    float: left;
  }

  .pi-remark {
    // padding-left: 80px;
    font-size: 14px;
  }

  .pi-remark-content {
    width: 812px;
    overflow: auto;
    word-break: break-all;
    border: 1px solid #727171;
    padding: 10px;
  }
  .pi-w170 {
    width: 17%;
    height: 200px;
    float: left;
    writing-mode:vertical-lr;
    padding-left: 6%;
  }
  .pi-w150 {
    width: 15%;
    height: 200px;
    float: left;
    writing-mode:vertical-lr;
    padding-left: 4.5%;
  }
  .pi-w340 {
    width: 34%;
    height: 200px;
    float: left;
  }
  .head-img {
    height: 198px;
    width: 100%;
  }
</style>
<template>
  <div>
    <Modal v-model="controlData.showDetail" title="个人信息" width="1000px">
      <Form :model="userInfo" label-position="right" :label-width="100">
        <div class="pi-modal-form">
          <div class="pi-w140 pi-form-border">
            <img class="pi-photo" :src="userInfo.photo">
<!--            <Icon @click="updatePhoto" type="md-camera" size="20"-->
<!--                  style="position:absolute;z-index:100;left:210px;top: 220px"/>-->
          </div>
          <div class="pi-w90 pi-form-border pi-form-title">姓名</div>
          <div class="pi-w160 pi-form-border pi-form-content">
            <input type="text" class="pi-form-input" v-model="userInfo.name">
          </div>
          <div class="pi-w90 pi-form-border pi-form-title">性别</div>
          <div class="pi-w120 pi-form-border pi-form-content">
            <Select v-model="userInfo.sex" class="pi-form-input">
              <Option :value="'男'" :key="1">男</Option>
              <Option :value="'女'" :key="2">女</Option>
            </Select>
          </div>
          <div class="pi-w90 pi-form-border pi-form-title">民族</div>
          <div class="pi-w120 pi-form-border pi-form-content pi-form-right">
            <input type="text" class="pi-form-input" v-model="userInfo.folk">
          </div>
          <div class="pi-w90 pi-form-border pi-form-title">身份证号</div>
          <div class="pi-w160 pi-form-border pi-form-content">{{userInfo.cardno}}</div>
          <div class="pi-w90 pi-form-border pi-form-title">政治面貌</div>
          <div class="pi-w120 pi-form-border pi-form-content">
             <Select v-model="userInfo.political_outlook" class="pi-form-input">
              <Option v-for="item in selectList.political_outlookList" :value="item.value" :key="item.value">
                {{item.label}}
              </Option>
            </Select>
          </div>
          <div class="pi-w90 pi-form-border pi-form-title">居住情况</div>
          <div class="pi-w120 pi-form-border pi-form-content pi-form-right">
            <Select v-model="userInfo.living_condition" class="pi-form-input">
              <Option v-for="item in selectList.living_conditionList" :value="item.value" :key="item.value">
                {{item.label}}
              </Option>
            </Select>
          </div>
          <div class="pi-w90 pi-form-border pi-form-title">英文姓名</div>
          <div class="pi-w160 pi-form-border pi-form-content">
            <input type="text" class="pi-form-input" v-model="userInfo.ename">
          </div>
          <div class="pi-w90 pi-form-border pi-form-title">住址</div>
          <div class="pi-w390 pi-form-border pi-form-content pi-form-right">
            <input type="text" class="pi-form-input" v-model="userInfo.present_address">
          </div>
          <div class="pi-w90 pi-form-border pi-form-title">户籍地址</div>
          <div class="pi-w580 pi-form-border pi-form-content pi-form-right">
            <input type="text" class="pi-form-input" v-model="userInfo.register_address">
          </div>
          <div class="pi-w140 pi-form-border pi-form-title">联系方式</div>
          <div class="pi-w140 pi-form-border pi-form-content">
            <input class="pi-form-input" v-model="userInfo.mobile" type="text ">
          </div>
          <div class="pi-w140 pi-form-border pi-form-title">现住地址</div>
          <div class="pi-w490 pi-form-border pi-form-content pi-form-right">
            <input type="text" class="pi-form-input" v-model="userInfo.present_address">
          </div>
          <div class="pi-w140 pi-form-border pi-form-title">银行卡收入情况</div>
          <div class="pi-w140 pi-form-border pi-form-content">
            <Select v-model="userInfo.personal_income" class="pi-form-input">
              <Option v-for="item in selectList.personal_incomeList" :value="item.value" :key="item.value">
                {{item.label}}
              </Option>
            </Select>
          </div>
          <div class="pi-w140 pi-form-border pi-form-title">职业</div>
          <div class="pi-w120 pi-form-border pi-form-content">
            <Select v-model="userInfo.occupation" class="pi-form-input">
              <Option v-for="item in selectList.occupationList" :value="item.value" :key="item.value"> {{item.label}}
              </Option>
            </Select>
          </div>
          <div class="pi-w90 pi-form-border pi-form-title">工作单位</div>
          <div class="pi-w180 pi-form-border pi-form-content pi-form-right">
            <input type="text" class="pi-form-input" v-model="userInfo.work_unit">
          </div>
          <div class="pi-w140 pi-form-border pi-form-title">文化程度</div>
          <div class="pi-w140 pi-form-border pi-form-content">
            <Select v-model="userInfo.education" class="pi-form-input">
              <Option v-for="item in selectList.educationList" :value="item.value" :key="item.value">{{item.label}}
              </Option>
            </Select>
          </div>
          <div class="pi-w140 pi-form-border pi-form-title">婚姻状况</div>
          <div class="pi-w120 pi-form-border pi-form-content">
            <Select v-model="userInfo.marriage" class="pi-form-input">
              <Option v-for="item in selectList.marriageList" :value="item.value" :key="item.value">{{item.label}}
              </Option>
            </Select>
          </div>
          <div class="pi-w90 pi-form-border pi-form-title">生育子女</div>
          <div class="pi-w180 pi-form-border pi-form-content pi-form-right">
            <Select v-model="userInfo.child" class="pi-form-input">
              <Option v-for="item in selectList.childList" :value="item.value" :key="item.value">{{item.label}}</Option>
            </Select>
          </div>
          <div class="pi-w140 pi-form-border pi-form-title">兵役情况</div>
          <div class="pi-w140 pi-form-border pi-form-content">
            <Select v-model="userInfo.military" class="pi-form-input">
              <Option :value="'是'" :key="5">是</Option>
              <Option :value="'否'" :key="6">否</Option>
            </Select>
          </div>
          <div class="pi-w140 pi-form-border pi-form-title">国籍</div>
          <div class="pi-w120 pi-form-border pi-form-content">
            <Select v-model="select1" class="pi-form-input">
              <Option v-for="item in selectList1.countryList" :value="item.country_name" :key="item.country_name">{{item.country_name}}
              </Option>
            </Select>
          </div>
          <div class="pi-w90 pi-form-border pi-form-title">户籍-省</div>
          <div class="pi-w180 pi-form-border pi-form-content pi-form-right">
            <Select v-model="select2" class="pi-form-input" filterable>
              <Option v-for="item in selectList1.provinceList" :value="item.province_code" :key="item.province_code"> {{item.province_name}}
              </Option>
            </Select>
          </div>
          <div class="pi-w140 pi-form-border pi-form-title">户籍-市</div>
          <div class="pi-w140 pi-form-border pi-form-content">
            <Select v-model="select3" class="pi-form-input" filterable>
              <Option v-for="item in selectList1.cityList" :value="item.city_code" :key="item.city_code"> {{item.city_name}}
              </Option>
            </Select>
          </div>
          <div class="pi-w140 pi-form-border pi-form-title">户籍-区</div>
          <div class="pi-w490 pi-form-border pi-form-content pi-form-right">
            <Select v-model="userInfo.register_area" class="pi-form-input" filterable>
              <Option v-for="item in selectList1.areaList" :value="item.area_code" :key="item.area_code">{{item.area_name}}
              </Option>
            </Select>
          </div>
          <div class="pi-w140 pi-form-border pi-form-title">父亲姓名</div>
          <div class="pi-w140 pi-form-border pi-form-content">
            <input type="text" class="pi-form-input" v-model="userInfo.fq_xm">
          </div>
          <div class="pi-w140 pi-form-border pi-form-title">父亲-证件类型</div>
          <div class="pi-w120 pi-form-border pi-form-content">
            <Select v-model="userInfo.fq_card_type" class="pi-form-input">
              <Option v-for="obj in dicList" :value="obj.value" :key="obj.id">{{obj.label}}</Option>
            </Select>
          </div>
          <div class="pi-w90 pi-form-border pi-form-title">父亲证件号码</div>
          <div class="pi-w180 pi-form-border pi-form-content pi-form-right">
            <input type="text" class="pi-form-input" v-model="userInfo.fq_card_no">
          </div>
          <div class="pi-w140 pi-form-border pi-form-title">母亲姓名</div>
          <div class="pi-w140 pi-form-border pi-form-content">
            <input type="text" class="pi-form-input" v-model="userInfo.mq_xm">
          </div>
          <div class="pi-w140 pi-form-border pi-form-title">母亲-证件类型</div>
          <div class="pi-w120 pi-form-border pi-form-content">
            <Select v-model="userInfo.mq_card_type" class="pi-form-input">
              <Option v-for="obj in dicList" :value="obj.value" :key="obj.id">{{obj.label}}</Option>
            </Select>
          </div>
          <div class="pi-w90 pi-form-border pi-form-title">母亲证件号码</div>
          <div class="pi-w180 pi-form-border pi-form-content pi-form-right">
            <input type="text" class="pi-form-input" v-model="userInfo.mq_card_no">
          </div>
          <div class="pi-w140 pi-form-border pi-form-title">配偶姓名</div>
          <div class="pi-w140 pi-form-border pi-form-content">
            <input type="text" class="pi-form-input" v-model="userInfo.po_xm">
          </div>
          <div class="pi-w140 pi-form-border pi-form-title">配偶-证件类型</div>
          <div class="pi-w120 pi-form-border pi-form-content">
            <Select v-model="userInfo.po_card_type" class="pi-form-input">
              <Option v-for="obj in dicList" :value="obj.value" :key="obj.id">{{obj.label}}</Option>
            </Select>
          </div>
          <div class="pi-w90 pi-form-border pi-form-title">配偶证件号码</div>
          <div class="pi-w180 pi-form-border pi-form-content pi-form-right">
            <input type="text" class="pi-form-input" v-model="userInfo.po_card_no">
          </div>
<!--          <div class="pi-w140 pi-form-border pi-form-title">重点人群</div>-->
<!--          <div class="pi-w670 pi-form-border pi-form-content pi-form-right">-->
<!--            <Select v-model="controlData.personTags" multiple class="pi-form-input">-->
<!--              <Option v-for="item in selectList.labelTagList" :value="item.value" :max-tag-count="5"-->
<!--                      :key="item.value">{{item.label}}-->
<!--              </Option>-->
<!--            </Select>-->
<!--          </div>-->
          <div class="pi-w170 pi-form-border pi-form-title pi-form-bottom">身份证正面照片</div>
          <div class="pi-w340 pi-form-border pi-form-title pi-form-bottom" style="position: relative;">
            <img :src="nophoto" alt="..." class="head-img">
            <Icon type="md-arrow-round-up" style="position: absolute;left:5%;top: 90%;cursor: pointer;" @click="uploadPositiveImg('Positive')" />
            <Icon type="ios-trash" style="position: absolute;left: 90%;top: 90%;cursor: pointer;" @click="deleteZm('Positive')" />
          </div>
          <div class="pi-w150 pi-form-border pi-form-title pi-form-bottom">身份证背面照片</div>
          <div class="pi-w340 pi-form-border pi-form-title pi-form-bottom pi-form-right" style="position: relative;">
            <img :src="nophoto1" alt="..." class="head-img">
            <Icon type="md-arrow-round-up" style="position: absolute;left: 5%;top: 90%;cursor: pointer;" @click="uploadPositiveImg('Back')" />
            <Icon type="ios-trash" style="position: absolute;left: 90%;top: 90%;cursor: pointer;" @click="deleteZm('Back')" />
          </div>
          <template>
            <focuss-group :user-info="userInfo"></focuss-group>
          </template>
          <template>
              <users-grid :user-info="userInfo" :control-data="controlData" :severUserInfo="severUserInfo"></users-grid>
          </template>
          <br/>
          <div class="pi-remark">备注：</div>
          <div class="person-info-text-center">
            <textarea class="pi-remark-content" v-model="userInfo.remarks" rows="5"/>
          </div>
        </div>
      </Form>
      <div slot="footer">
        <Button size="large" @click="controlData.showDetail=false">取消</Button>
        <Button type="primary" size="large" @click="saveUser">确定</Button>
      </div>
    </Modal>
    <Modal
      v-model="PhotoModal"
      width="400"
      title="上传头像">
      <Button type="primary" style="margin-right: 15px" @click="PZPhoto">拍照</Button>
      <Button type="primary" @click="SCPhoto">上传</Button>
    </Modal>
    <Modal v-model="up_pic_mol" title="图片上传" :closable="false">
      <Upload multiple action="http://10.40.20.4:8081/api/uc/mzsc/uploadService/uploadPic"
              :before-upload="beforeUpload">
        <Button icon="ios-cloud-upload-outline">上传图片</Button>
        <span style="margin-left: 250px">请上传小于2M的图片</span>
      </Upload>
      <img :src="temp_photo" style="width: 100%"/>
    </Modal>
    <Modal v-model="face_mol" title="拍照" @on-visible-change="modalChange" width="700">
      <face-camera :isPlay="face_shows" :extraData="upPicData" :file-path="filePath"
                   :file-name="fileName" @img-result="imgResult"></face-camera>
      <div slot="footer">
        <Button type="error" @click="face_mol=false">关闭</Button>
      </div>
    </Modal>
    <Modal
      v-model="mshow"
      title="高拍仪"
      @on-visible-change="modalChange3" @on-cancel="closeHeight1" @on-ok="closeHeight1">
      <wl-equipment
        :file-path="filePath"
        :file-name="fileName"
        v-model="obj"
        :type="type"
        :is-open="openNow"
        user_idcard="cardId"
        ref="wlEquipment"
        @change1="change1"
      ></wl-equipment>
    </Modal>
    <Modal v-model="up_pic_mol1" title="图片上传" @on-ok="changeToView" :closable="false">
      <Upload multiple action="http://120.27.63.37:38081/api/ac/file/fileCommonService/upLoadFiles" :before-upload="beforeUpload">
        <Button icon="ios-cloud-upload-outline">上传图片</Button>
        <span style="margin-left: 250px">请上传小于8M的图片</span>
      </Upload>
      <img :src="temp_photo1" style="width: 100%"/>
    </Modal>
  </div>
</template>

<script>
import itemdata from './itemdata'
import { createuser } from '@/api/mainv3'
import { getSign, createUpLoadFiles, getDictList } from '@/api/common'
import WlEquipment from '@/components/wl-equipment/index'
import FaceCamera from '@/components/face-camera/index'
import UsersGrid from './userGrid'
import { getProvinceList, getCityList, getAreaList, getCountryList, addUser } from '@/api/grid'
import nophoto from '@/assets/images/nophoto.jpeg'
import nophoto1 from '@/assets/images/nophoto1.jpeg'
import FocussGroup from './focus-group'

export default {
  name: 'PersonnelInfoModal',
  props: {
    userInfo: Object,
    controlData: Object,
    severUserInfo: Object
  },
  components: {
    FocussGroup,
    UsersGrid,
    FaceCamera,
    WlEquipment
  },
  data () {
    return {
      up_pic_mol1: false,
      nophoto,
      nophoto1,
      face_mol: false,
      filePath: '',
      fileName: '',
      type: '',
      openNow: false,
      obj: {},
      gpy_mol: false,
      face_shows: false,
      mshow: false,
      up_pic_mol: false,
      temp_photo: '',
      PhotoModal: false,
      // 小区，组，楼，单元，层，户，选中项和备选项列表
      selectList: {
        co_residentList: itemdata.co_residentList,
        personal_incomeList: itemdata.personal_incomeList,
        living_conditionList: itemdata.living_conditionList,
        educationList: itemdata.educationList,
        childList: itemdata.childList,
        marriageList: itemdata.marriageList,
        political_outlookList: itemdata.political_outlookList,
        occupationList: itemdata.occupationList
        // labelTagList: itemdata.labelTagList
      },
      upPicData: {
        fileName: '',
        filePath: ''
      },
      selectList1: {
        countryList: [], // 国籍列表
        provinceList: [], // 省列表
        cityList: [], // 市列表
        areaList: [] // 区列表
      },
      select1: '', // 国籍
      select2: '', // 省
      select3: '', // 市
      select4: '', // 区
      tempInfo: {},
      dicList: [], // 证件类型
      imgType: '',
      temp_photo1: ''
    }
  },
  watch: {
    userInfo (val) {
      this.tempInfo = val
      console.log(this.tempInfo.sfz_zm, '个人信息')
      if (this.tempInfo.sfz_zm !== '' && this.tempInfo.sfz_zm !== undefined) {
        this.nophoto = this.tempInfo.sfz_zm
      } else {
        this.nophoto = ''
      }
      if (this.tempInfo.sfz_fm !== '' && this.tempInfo.sfz_fm !== undefined) {
        this.nophoto1 = this.tempInfo.sfz_fm
      } else {
        this.nophoto1 = ''
      }
      this.select1 = val.register_country
    },
    select1 (val) {
      this.userInfo.register_country = val
      // 获取省信息
      if (val === '中国') {
        this.getProvinceInfo()
      } else {
        this.select2 = ''
        this.select3 = ''
        this.select4 = ''
      }
    },
    select2 (val) {
      this.userInfo.register_province = val
      // 市信息
      getCityList({ province_code: val }).then(res => {
        if (res.data.errcode === 0) {
          this.selectList1.cityList = res.data.data
          for (var i = 0; i < this.selectList1.cityList.length; i++) {
            if (this.tempInfo.register_city === this.selectList1.cityList[i].city_code) {
              this.select3 = this.selectList1.cityList[i].city_code
            }
          }
        } else {
          this.$Notice.error({ title: '失败', desc: res.data.errmsg })
        }
      })
    },
    select3 (val) {
      this.userInfo.register_city = val
      // 区信息
      getAreaList({ city_code: val }).then(res => {
        if (res.data.errcode === 0) {
          this.selectList1.areaList = res.data.data
          for (var i = 0; i < this.selectList1.areaList.length; i++) {
            if (this.tempInfo.register_area === this.selectList1.areaList[i].area_code) {
              this.select4 = this.selectList1.areaList[i].area_code
            }
          }
        } else {
          this.$Notice.error({ title: '失败', desc: res.data.errmsg })
        }
      })
    },
    select4 (val) {
      this.userInfo.register_area = val
    }
  },
  methods: {
    deleteZm (type) {
      console.log(type, '删除')
      if (type === 'Positive') {
        this.nophoto = ''
        this.userInfo.sfz_zm = ''
      } else if (type === 'Back') {
        this.nophoto1 = ''
        this.userInfo.sfz_fm = ''
      }
    },
    changeToView () {
      if (this.imgType === 'Positive') {
        this.nophoto = this.temp_photo1
      } else if (this.imgType === 'Back') {
        this.nophoto1 = this.temp_photo1
      }
    },
    uploadPositiveImg (type) { // 正面上传
      this.temp_photo1 = ''
      this.imgType = type
      this.up_pic_mol1 = true
      if (type === 'Positive') {
        this.upPicData.fileName = '身份证正面' + this.datetime2str(new Date()) + '.png'
      } else if (type === 'Back') {
        this.upPicData.fileName = '身份证背面' + this.datetime2str(new Date()) + '.png'
      }
      this.upPicData.filePath = 'userinfo/' + '/' + 'userid'
    },
    getCountryInfo () {
      getCountryList({}).then(res => {
        if (res.data.errcode === 0) {
          this.selectList1.countryList = res.data.data
        } else {
          this.$Notice.error({ title: '失败', desc: res.data.errmsg })
        }
      })
    },
    getProvinceInfo () {
      getProvinceList({}).then(res => {
        if (res.data.errcode === 0) {
          this.selectList1.provinceList = res.data.data
          for (var i = 0; i < this.selectList1.provinceList.length; i++) {
            if (this.tempInfo.register_province === this.selectList1.provinceList[i].province_code) {
              this.select2 = this.selectList1.provinceList[i].province_code
            }
          }
        } else {
          this.$Notice.error({ title: '失败', desc: res.data.errmsg })
        }
      })
    },
    // 获取字典数据
    getDicInfo () { // 证件类型
      getDictList({ 'type': 'csc_squser_cardtype' }).then(ret => {
        if (ret.data.errcode === 0) {
          this.dicList = ret.data.data.results
        } else {
          this.$Notice.error({ title: '获取字典列表失败', desc: '' })
        }
      })
    },
    closeHeight1 () {
      this.mshow = false
      this.openNow = false
    },
    modalChange (e) {
      this.face_shows = e
    },
    modalChange3 (e) {
      this.openNow = e
    },
    // 新高拍仪拍照回调函数
    change1 (data) {
      if (data.url) {
        this.userInfo.photo = data.url
        this.userInfo.photo = data.url
      } else {
        this.$Notice.error({ title: '拍照失败,请重新拍摄' })
      }
    },
    imgResult (data) {
      console.log(data, '!@#$')
      this.face_mol = false
      this.face_shows = false
      this.PhotoModal = false
      this.userInfo.photo = data
      this.userInfo.photo = data
    },
    PZPhoto () {
      if (this.severUserInfo.email === 'JieYuDevice') {
        this.face_mol = true
        this.gpy_mol = true
        // alert(123)
      } else {
        this.type = 'faceCamera'
        this.mshow = true
        this.openNow = true
        this.PhotoModal = false
      }
      this.upPicData.fileName = this.datetime2str(new Date()) + '.png'
      this.fileName = this.datetime2str(new Date()) + '.png'
      this.upPicData.filePath = 'userphoto/' + this.datetime2str(new Date())
      this.filePath = this.upPicData.filePath
      // this.formItem.paramIndex = params.index
    },
    // 时间转字符串 年月日时分秒
    datetime2str (date) {
      let time1 = date.getFullYear() + ''
      let month = date.getMonth() + 1
      let day = date.getDate()
      let hh = date.getHours()
      let mm = date.getMinutes()
      let ss = date.getSeconds()
      time1 += month < 10 ? '0' + month : month
      time1 += day < 10 ? '0' + day : day
      time1 += hh < 10 ? '0' + hh : hh
      time1 += mm < 10 ? '0' + mm : mm
      time1 += ss < 10 ? '0' + ss : ss
      return time1
    },
    beforeUpload (file) {
      this.upPicData.fileName = this.upPicData.fileName + '.' + file.type.substring(6)
      let that = this
      const reader = new FileReader()
      reader.readAsDataURL(file)
      reader.onload = () => {
        let index = reader.result.indexOf('base64,') + 7
        that.upPicData.file = reader.result.substring(index)
        that.upPic(that.upPicData)
      }
      return false
    },
    upPic (obj) {
      var time = new Date().getTime()
      this.timeStep = time.toString()
      let param = {
        filePath: obj.filePath,
        fileName: obj.fileName,
        timestamp: this.timeStep
      }
      getSign(param).then(res => {
        if (res.data.errcode === 0) {
          createUpLoadFiles(res.data.data.docking_url, {
            sign: res.data.data.sign,
            timestamp: this.timeStep,
            filePath: obj.filePath,
            fileName: obj.fileName,
            file: obj.file
          }).then(res => {
            if (res.data.errcode === 0) {
              console.log(this.imgType, '照片类型')
              let imgurl = res.data.data
              if (this.imgType === 'Positive') {
                this.temp_photo1 = imgurl
                this.userInfo.sfz_zm = imgurl
              } else if (this.imgType === 'Back') {
                this.temp_photo1 = imgurl
                this.userInfo.sfz_fm = imgurl
              } else {
                this.temp_photo = imgurl
                this.userInfo.photo = imgurl
              }
            } else {
              this.$Notice.error({ title: '上传失败', desc: res.data.data.msg })
            }
          })
        } else {
          this.$Notice.error({ title: '上传失败', desc: res.data.data.msg })
        }
      })
    },
    SCPhoto () {
      this.up_pic_mol = true
      this.PhotoModal = false
    },
    updatePhoto () {
      this.PhotoModal = true
    },
    saveUser () {
      this.controlData.showDetail = false
    },
    uploadCardInfo (userInfo) {
      createuser(userInfo).then(res => {
        if (res.data.errcode === 0) {
          this.$Notice.success({ title: '个人信息更新成功' })
          this.controlData.showDetail = false
          this.$emit('result', this.controlData.cardno)
          let data = {
            cardno: this.controlData.cardno
          }
          addUser(data).then(ret => {})
        } else {
          this.$Notice.error({ title: '个人信息更新失败', desc: res.data.errmsg })
        }
      })
    }
    // photoShow (val) {
    //   console.log(val, 'val')
    //   this.userInfo.photo = val
    // }
  },
  mounted () {
    this.getCountryInfo()
    console.log(this.userInfo)
    this.getDicInfo()
    // this.getProvinceInfo()
  }
}
</script>
